{% extends 'base_site.html' %}
{% load static %}

{% block title %}
    Redis实验
{% endblock %}

{% block main %}
    {% csrf_token %}
    <div class="container mt-4">
        <h1>所有商品</h1>
        <p>{{ time }}</p>
        <table class="table table-hover table-striped">
            <thead>
            <tr>
                <th scope="col">#</th>
                <th scope="col">商品名称</th>
                <th scope="col" style="width: 10%">商品价格（元）</th>
                <th scope="col" style="width: 10%">商品库存（件）</th>
            </tr>
            </thead>
            <tbody>
            {% for item in goods_list %}
                <tr>
                    <th scope="row"> {{ item.id }}</th>
                    <td>{{ item.name }}</td>
                    <td>{{ item.price }}</td>
                    <td>{{ item.storage }}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>

    <script src="/static/js/bootstrap.bundle.js"></script>
    <script>function logout() {
        document.getElementById('logout-form').submit();
    }
    </script>
{% endblock %}